package com.wdh.kjs.fragment;

import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.LinkAddress;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.google.gson.Gson;
import com.lidroid.xutils.HttpUtils;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.RequestParams;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.http.client.HttpRequest;
import com.wdh.kjs.R;
import com.wdh.kjs.activity.AddBankCardActivity;
import com.wdh.kjs.activity.BindBankCardActivity;
import com.wdh.kjs.activity.FaRenBangdingActivity;
import com.wdh.kjs.activity.JieKuanXYActivity;
import com.wdh.kjs.activity.LoginActivity;
import com.wdh.kjs.activity.RealNameAuthActivity;
import com.wdh.kjs.activity.RongziActivity;
import com.wdh.kjs.activity.SetTradePasswordActivity;
import com.wdh.kjs.http.Httpurl;
import com.wdh.kjs.model.JsonModel;
import com.wdh.kjs.util.ToastUtils;

/**
 * Created by codingWw on 2016/3/7.
 */
public class FinanceFragment extends Fragment implements View.OnClickListener{
    private Intent intent;
    private Button button;
    private TextView un_set;
    private TextView un_auth;
    private TextView un_bind;
    private TextView un_set_org;
    private TextView un_auth_org;
    private TextView un_bind_org;
    private ImageView un_auth_image;
    private ImageView un_set_image;
    private ImageView un_bind_image;
    private ImageView un_auth_image_org;
    private ImageView un_set_image_org;
    private ImageView un_bind_image_org;
    private TextView text1;
    private TextView text2;
    private TextView text3;
    private TextView text4;
    private TextView text5;
    private TextView tv_jiekuanxieyi; //3
    private TextView tv_rucangxieyi; //4
    private TextView tv_dongchangxieyi;  //5
    private TextView tv_rucangzhuangrangxieyi;  //6
    private TextView tv_jiekuanjinrongdaixieyi;   //7
    private TextView tv_fengxianxieyi;  //9
    private LinearLayout layout1;
    private LinearLayout layout2;
    private LinearLayout layout3;
    private LinearLayout layout4;
    private LinearLayout layout5;
    private LinearLayout ii_organize;
    private LinearLayout ii_geren;
    private LinearLayout un_auth_LinearLayout;
    private LinearLayout un_set_LinearLayout;
    private LinearLayout un_bind_LinearLayout;
    private LinearLayout un_auth_LinearLayout_org;
    private LinearLayout un_set_LinearLayout_org;
    private LinearLayout un_bind_LinearLayout_org;
    private CheckBox CheckBox_finance;
    private String levels;
    private String gdItemType="";
    private String partyId;
    private String type;
    private JsonModel jsonModel;
    private String auditingOpinion;


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_finance, container, false);
        SharedPreferences sharedPreferences = getActivity().getSharedPreferences("logininfo", Context.MODE_PRIVATE);
        levels = sharedPreferences.getString("levels","");
        partyId = sharedPreferences.getString("loginToken", "");
        type = sharedPreferences.getString("type", "");
        initview(view);
        initwidge();

        if(type.equals("p")) {
            initshiming();
            ii_geren.setVisibility(View.VISIBLE);
            ii_organize.setVisibility(View.GONE);

        }else if (type.equals("o")){
            initshimingorgnize();
            ii_geren.setVisibility(View.GONE);
            ii_organize.setVisibility(View.VISIBLE);
        }
        if (partyId.equals("")) {
            intent = new Intent(getActivity(), LoginActivity.class);
            intent.putExtra("state", "0");
            startActivity(intent);
        }
        Log.i("msg", levels);

        return view;
    }
    private void initshimingorgnize() {
        HttpUtils http = new HttpUtils();
        RequestParams params = new RequestParams();

//            params.addBodyParameter("emailAddress","742051747@qq.com" );
        params.addBodyParameter("partyId", partyId);

        http.send(HttpRequest.HttpMethod.POST, Httpurl.URL_HUOQURENZHENG_O, params, new RequestCallBack<String>() {

            @Override
            public void onSuccess(ResponseInfo<String> responseInfo) {


                Gson gson = new Gson();
                jsonModel = gson.fromJson(responseInfo.result, JsonModel.class);
                if (jsonModel.success) {

                    auditingOpinion = jsonModel.getRealAuthInfo().getAuditingOpinion();
                    if (!auditingOpinion.equals("0")) {
                        un_auth_org.setText("已认证");
                        un_auth_image_org.setImageResource(R.drawable.financing_did);
                    } else {
                        un_auth_org.setText("未认证");
                        un_auth_image_org.setImageResource(R.drawable.financing_didn_t);
                    }
                }
                else {
                    un_auth_org.setText("未认证");
                    un_auth_image_org.setImageResource(R.drawable.financing_didn_t);
                }

            }

            @Override
            public void onFailure(HttpException error, String msg) {


            }
        });

    }
    private void initshiming() {
        HttpUtils http = new HttpUtils();
        RequestParams params = new RequestParams();

//            params.addBodyParameter("emailAddress","742051747@qq.com" );
        params.addBodyParameter("partyId", partyId);

        http.send(HttpRequest.HttpMethod.POST, Httpurl.URL_HUOQURENZHENG, params, new RequestCallBack<String>() {

            @Override
            public void onSuccess(ResponseInfo<String> responseInfo) {


                Gson gson = new Gson();
                jsonModel = gson.fromJson(responseInfo.result, JsonModel.class);
                if (jsonModel.success) {
                    auditingOpinion = jsonModel.getRealAuthInfo().getAuditingOpinion();
                    if (!auditingOpinion.equals("0")) {
                        un_auth.setText("已认证");
                        un_auth_image.setImageResource(R.drawable.financing_did);
                    } else {
                        un_auth.setText("未认证");
                        un_auth_image.setImageResource(R.drawable.financing_didn_t);
                    }
                } else {
                    un_auth.setText("未认证");
                    un_auth_image.setImageResource(R.drawable.financing_didn_t);
                }
            }

            @Override
            public void onFailure(HttpException error, String msg) {


            }
        });

    }

    private void initwidge() {

        switch (levels){
            case "0":
                if (type.equals("p")) {
                    un_auth.setText("未认证");
                    un_auth_image.setImageResource(R.drawable.financing_didn_t);
                    un_set.setText("未设置");
                    un_set_image.setImageResource(R.drawable.financing_didn_t);
                    un_bind.setText("未绑定");
                    un_bind_image.setImageResource(R.drawable.financing_didn_t);
                    un_auth_LinearLayout.setOnClickListener(this);
                    un_set_LinearLayout.setOnClickListener(this);
                    un_bind_LinearLayout.setOnClickListener(this);
                }else {
                    un_auth_org.setText("未认证");
                    un_auth_image_org.setImageResource(R.drawable.financing_didn_t);
                    un_set_org.setText("未验证");
                    un_set_image_org.setImageResource(R.drawable.financing_didn_t);
                    un_bind_org.setText("未设置");
                    un_bind_image_org.setImageResource(R.drawable.financing_didn_t);
                    un_auth_LinearLayout_org.setOnClickListener(this);
                    un_set_LinearLayout.setOnClickListener(this);
                    un_bind_LinearLayout.setOnClickListener(this);
                }

                break;
            case "1":
                if (type.equals("p")) {
                    un_set.setText("未设置");
                    un_set_image.setImageResource(R.drawable.financing_didn_t);
                    un_bind.setText("未绑定");
                    un_bind_image.setImageResource(R.drawable.financing_didn_t);
                    un_set_LinearLayout.setOnClickListener(this);
                    un_bind_LinearLayout.setOnClickListener(this);
                }
                else {
                    un_set_org.setText("未验证");
                    un_set_image_org.setImageResource(R.drawable.financing_didn_t);
                    un_bind_org.setText("未设置");
                    un_bind_image_org.setImageResource(R.drawable.financing_didn_t);
                }

                break;
            case "2":
                if (type.equals("p")) {
                    un_set.setText("已设置");
                    un_set_image.setImageResource(R.drawable.financing_did);
                    un_bind.setText("未绑定");
                    un_bind_image.setImageResource(R.drawable.financing_didn_t);
                    un_bind_LinearLayout.setOnClickListener(this);
                }else {
                    un_set_org.setText("已验证");
                    un_set_image_org.setImageResource(R.drawable.financing_did);
                    un_bind_org.setText("未设置");
                    un_bind_image_org.setImageResource(R.drawable.financing_didn_t);
                }

                break;
            case "3":
                if (type.equals("p")) {
                    un_set.setText("已设置");
                    un_set_image.setImageResource(R.drawable.financing_did);
                    un_bind.setText("已绑定");
                    un_bind_image.setImageResource(R.drawable.financing_did);
                }else {
                    un_set_org.setText("已验证");
                    un_set_image_org.setImageResource(R.drawable.financing_did);
                    un_bind_org.setText("已设置");
                    un_bind_image_org.setImageResource(R.drawable.financing_did);
                }
                break;
        }

        tv_jiekuanxieyi.setOnClickListener(this);
        tv_rucangxieyi.setOnClickListener(this);
        tv_dongchangxieyi.setOnClickListener(this);
        tv_rucangzhuangrangxieyi.setOnClickListener(this);
        tv_jiekuanjinrongdaixieyi.setOnClickListener(this);
        tv_fengxianxieyi.setOnClickListener(this);
        button.setOnClickListener(this);
        layout1.setOnClickListener(this);
        layout2.setOnClickListener(this);
        layout3.setOnClickListener(this);
        layout4.setOnClickListener(this);
        layout5.setOnClickListener(this);
        un_bind_LinearLayout_org.setOnClickListener(this);
        un_set_LinearLayout_org.setOnClickListener(this);
    }

    private void initview(View view) {
        un_set_LinearLayout_org = (LinearLayout) view.findViewById(R.id.un_set_LinearLayout_org);
        ii_organize = (LinearLayout) view.findViewById(R.id.ii_organize);
        ii_geren = (LinearLayout) view.findViewById(R.id.ii_geren);
        tv_jiekuanxieyi = (TextView) view.findViewById(R.id.tv_jiekuanxieyi);
        tv_rucangxieyi = (TextView) view.findViewById(R.id.tv_rucangxieyi);
        tv_dongchangxieyi = (TextView) view.findViewById(R.id.tv_dongchangxieyi);
        tv_rucangzhuangrangxieyi = (TextView) view.findViewById(R.id.tv_rucangzhuangrangxieyi);
        tv_jiekuanjinrongdaixieyi = (TextView) view.findViewById(R.id.tv_jiekuanjinrongdaixieyi);
        tv_fengxianxieyi = (TextView) view.findViewById(R.id.tv_fengxianxieyi);
        CheckBox_finance = (CheckBox) view.findViewById(R.id.CheckBox_finance);
        button = (Button) view.findViewById(R.id.fragment_finance_confirm);
        un_set = (TextView) view.findViewById(R.id.un_set);
        un_auth = (TextView) view.findViewById(R.id.un_auth);
        un_bind = (TextView) view.findViewById(R.id.un_bind);
        un_set_org = (TextView) view.findViewById(R.id.un_set_org);
        un_auth_org = (TextView) view.findViewById(R.id.un_auth_org);
        un_bind_org = (TextView) view.findViewById(R.id.un_bind_org);
        un_set_image = (ImageView) view.findViewById(R.id.un_set_image);
        un_auth_image_org = (ImageView) view.findViewById(R.id.un_auth_image_org);
        un_auth_image = (ImageView) view.findViewById(R.id.un_auth_image);
        un_bind_image = (ImageView) view.findViewById(R.id.un_bind_image);
        un_set_image_org = (ImageView) view.findViewById(R.id.un_set_image_org);
        un_bind_image_org = (ImageView) view.findViewById(R.id.un_bind_image_org);
        un_auth_LinearLayout = (LinearLayout) view.findViewById(R.id.un_auth_LinearLayout);
        un_set_LinearLayout = (LinearLayout) view.findViewById(R.id.un_set_LinearLayout);
        un_bind_LinearLayout = (LinearLayout) view.findViewById(R.id.un_bind_LinearLayout);
        un_auth_LinearLayout_org = (LinearLayout) view.findViewById(R.id.un_auth_LinearLayout_org);
        un_set_LinearLayout_org = (LinearLayout) view.findViewById(R.id.un_set_LinearLayout_org);
        un_bind_LinearLayout_org = (LinearLayout) view.findViewById(R.id.un_bind_LinearLayout_org);
        text1 = (TextView) view.findViewById(R.id.text1);
        text2 = (TextView) view.findViewById(R.id.text2);
        text3 = (TextView) view.findViewById(R.id.text3);
        text4 = (TextView) view.findViewById(R.id.text4);
        text5 = (TextView) view.findViewById(R.id.text5);
        layout1 = (LinearLayout) view.findViewById(R.id.layout1);
        layout2 = (LinearLayout) view.findViewById(R.id.layout2);
        layout3 = (LinearLayout) view.findViewById(R.id.layout3);
        layout4 = (LinearLayout) view.findViewById(R.id.layout4);
        layout5 = (LinearLayout) view.findViewById(R.id.layout5);

        if (type.equals("p")) {
            layout1.setVisibility(View.GONE);
            layout2.setVisibility(View.GONE);
        } else {
            layout5.setVisibility(View.GONE);
        }
    }

    private void TipDialogShow(String hint) {
        View dialog = View.inflate(getContext(),R.layout.view_dialog_tip, null);
        Button bt_dialog_false_positive = (Button) dialog.findViewById(R.id.bt_dialog_false_positive);
        TextView tv_dialog_false_hint = (TextView) dialog.findViewById(R.id.tv_dialog_false_hint);
        tv_dialog_false_hint.setText(hint);
        AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
        builder.setView(dialog);
        builder.create();
        final AlertDialog dialogShow = builder.show();
        bt_dialog_false_positive.setOnClickListener(new android.view.View.OnClickListener() {

            @Override
            public void onClick(View v) {
                dialogShow.dismiss();
            }
        });
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {

            case R.id.tv_jiekuanxieyi:
                intent = new Intent(getActivity(), JieKuanXYActivity.class);
                intent.putExtra("sign", "3");
                startActivity(intent);
                break;
            case R.id.tv_rucangxieyi:
                intent = new Intent(getActivity(), JieKuanXYActivity.class);
                intent.putExtra("sign", "4");
                startActivity(intent);
                break;
            case R.id.tv_dongchangxieyi:
                intent = new Intent(getActivity(), JieKuanXYActivity.class);
                intent.putExtra("sign", "5");
                startActivity(intent);
                break;
            case R.id.tv_rucangzhuangrangxieyi:
                intent = new Intent(getActivity(), JieKuanXYActivity.class);
                intent.putExtra("sign", "6");
                startActivity(intent);
                break;
            case R.id.tv_jiekuanjinrongdaixieyi:
                intent = new Intent(getActivity(), JieKuanXYActivity.class);
                intent.putExtra("sign", "7");
                startActivity(intent);
                break;
            case R.id.tv_fengxianxieyi:
                intent = new Intent(getActivity(), JieKuanXYActivity.class);
                intent.putExtra("sign", "9");
                startActivity(intent);
                break;

            case R.id.fragment_finance_confirm:
if (auditingOpinion.equals("0")){
    TipDialogShow("请先完成实名认证！");
}
           else if (gdItemType.equals("")) {
                    TipDialogShow("请选择项目类型！");
//                    ToastUtils.showShort(FinanceFragment.super.getContext() , "请选择项目类型！");
                } else if (!CheckBox_finance.isChecked()) {
    TipDialogShow("请先阅读协议！");
//                    ToastUtils.showShort(FinanceFragment.super.getContext() , "请先阅读协议！");
                } else if (partyId.equals("")) {
                    intent = new Intent(getActivity(), LoginActivity.class);
                    intent.putExtra("state", "0");
    startActivity(intent);
                }else if (type.equals("p")&&!levels.equals("3")) {

                        TipDialogShow("未绑定银行卡！");

                }
                else if (type.equals("p")&&gdItemType.equals("3")){
                        TipDialogShow("暂未开通普惠三农贷！");
                    }else if(type.equals("o")&&!gdItemType.equals("2")){
                        TipDialogShow("当前只开通了物权抵押贷！");
                    } else if (type.equals("p")&&!levels.equals("3")) {
                  TipDialogShow("您未具备条件！");
              }
              else if (type.equals("o")&&!levels.equals("3")) {
                  TipDialogShow("您未具备条件！");
              }
                  else
              {
                    intent = new Intent(getActivity(), RongziActivity.class);
                    intent.putExtra("gdItemType", gdItemType);
                    startActivity(intent);
                }
                break;
            case R.id.un_auth_LinearLayout:
                intent = new Intent(getActivity(), RealNameAuthActivity.class);
                startActivity(intent);
                break;
            case R.id.un_set_LinearLayout_org:
                intent = new Intent(getActivity(), FaRenBangdingActivity.class);
                startActivity(intent);
                break;
            case R.id.un_auth_LinearLayout_org:
                intent = new Intent(getActivity(), RealNameAuthActivity.class);
                startActivity(intent);
                break;
            case R.id.un_set_LinearLayout:
                intent = new Intent(getActivity(), SetTradePasswordActivity.class);
                startActivity(intent);
                break;
            case R.id.un_bind_LinearLayout_org:
                intent = new Intent(getActivity(), SetTradePasswordActivity.class);
                startActivity(intent);
                break;
            case R.id.un_bind_LinearLayout:
                intent = new Intent(getActivity(), AddBankCardActivity.class);
                startActivity(intent);
                break;
            case R.id.layout1: // 政信资产贷
                text1.setTextColor(getResources().getColor(R.color.colorPrimary));
                text2.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text3.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text4.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text5.setTextColor(getResources().getColor(R.color.font_gray_dark));
                layout1.setBackgroundColor(getResources().getColor(R.color.background_light_blue));
                layout2.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout3.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout4.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout5.setBackgroundColor(getResources().getColor(R.color.background_white));
                gdItemType = "0";
                tv_jiekuanxieyi.setVisibility(View.GONE);
                tv_rucangxieyi.setVisibility(View.GONE);
                tv_dongchangxieyi.setVisibility(View.GONE);
                tv_rucangzhuangrangxieyi.setVisibility(View.GONE);
                tv_fengxianxieyi.setVisibility(View.GONE);
                tv_jiekuanjinrongdaixieyi.setVisibility(View.GONE);
                break;
            case R.id.layout2:  //中小企业担保贷
                text1.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text2.setTextColor(getResources().getColor(R.color.colorPrimary));
                text3.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text4.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text5.setTextColor(getResources().getColor(R.color.font_gray_dark));
                layout1.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout2.setBackgroundColor(getResources().getColor(R.color.background_light_blue));
                layout3.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout4.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout5.setBackgroundColor(getResources().getColor(R.color.background_white));
                gdItemType = "1";
                tv_jiekuanxieyi.setVisibility(View.GONE);
                tv_rucangxieyi.setVisibility(View.GONE);
                tv_dongchangxieyi.setVisibility(View.GONE);
                tv_rucangzhuangrangxieyi.setVisibility(View.GONE);
                tv_fengxianxieyi.setVisibility(View.GONE);
                tv_jiekuanjinrongdaixieyi.setVisibility(View.GONE);
                break;

            case R.id.layout3:  //物权质押贷
                text1.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text2.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text3.setTextColor(getResources().getColor(R.color.colorPrimary));
                text4.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text5.setTextColor(getResources().getColor(R.color.font_gray_dark));
                layout1.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout2.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout3.setBackgroundColor(getResources().getColor(R.color.background_light_blue));
                layout4.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout5.setBackgroundColor(getResources().getColor(R.color.background_white));
                tv_jiekuanxieyi.setVisibility(View.VISIBLE);
                tv_rucangxieyi.setVisibility(View.VISIBLE);
                tv_dongchangxieyi.setVisibility(View.VISIBLE);
                tv_rucangzhuangrangxieyi.setVisibility(View.VISIBLE);
                tv_fengxianxieyi.setVisibility(View.VISIBLE);
                tv_jiekuanjinrongdaixieyi.setVisibility(View.GONE);
                gdItemType = "2";
                break;
            case R.id.layout4:  //普惠三农贷
                text1.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text2.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text3.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text4.setTextColor(getResources().getColor(R.color.colorPrimary));
                text5.setTextColor(getResources().getColor(R.color.font_gray_dark));
                layout1.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout2.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout3.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout4.setBackgroundColor(getResources().getColor(R.color.background_light_blue));
                layout5.setBackgroundColor(getResources().getColor(R.color.background_white));
                tv_jiekuanxieyi.setVisibility(View.GONE);
                tv_rucangxieyi.setVisibility(View.GONE);
                tv_dongchangxieyi.setVisibility(View.GONE);
                tv_rucangzhuangrangxieyi.setVisibility(View.GONE);
                tv_fengxianxieyi.setVisibility(View.GONE);
                tv_jiekuanjinrongdaixieyi.setVisibility(View.GONE);
                gdItemType = "3";
                break;
            case R.id.layout5:  //消费金融贷
                text1.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text2.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text3.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text4.setTextColor(getResources().getColor(R.color.font_gray_dark));
                text5.setTextColor(getResources().getColor(R.color.colorPrimary));
                layout1.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout2.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout3.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout4.setBackgroundColor(getResources().getColor(R.color.background_white));
                layout5.setBackgroundColor(getResources().getColor(R.color.background_light_blue));
                gdItemType = "4";
                tv_jiekuanjinrongdaixieyi.setVisibility(View.VISIBLE);
                tv_fengxianxieyi.setVisibility(View.VISIBLE);
                tv_jiekuanxieyi.setVisibility(View.GONE);
                tv_rucangxieyi.setVisibility(View.GONE);
                tv_dongchangxieyi.setVisibility(View.GONE);
                tv_rucangzhuangrangxieyi.setVisibility(View.GONE);
                break;
        }
    }

    @Override
    public void onStop() {
        super.onStop();
        text1.setTextColor(getResources().getColor(R.color.font_gray_dark));
        text2.setTextColor(getResources().getColor(R.color.font_gray_dark));
        text3.setTextColor(getResources().getColor(R.color.font_gray_dark));
        text4.setTextColor(getResources().getColor(R.color.font_gray_dark));
        text5.setTextColor(getResources().getColor(R.color.font_gray_dark));
        layout1.setBackgroundColor(getResources().getColor(R.color.background_white));
        layout2.setBackgroundColor(getResources().getColor(R.color.background_white));
        layout3.setBackgroundColor(getResources().getColor(R.color.background_white));
        layout4.setBackgroundColor(getResources().getColor(R.color.background_white));
        layout5.setBackgroundColor(getResources().getColor(R.color.background_white));
        gdItemType="";
        CheckBox_finance.setChecked(false);
    }
}
